package Picture;

public class Triangle extends Graphics {
    String name;
    double side1;
    double side2;
    double side3;
    public Triangle(String name,double side1,double side2,double side3){
        super(name);
        this.name=name;
        this.side1=side1;
        this.side2=side2;
        this.side3=side3;
    }
    public void Circumference(){
        double c=side1+side2+side3;
        System.out.println("三角形的周长是："+c);
    }
    public void range(){
        double p=(side1+side2+side3)/2;
        double s=p*(p-side1)*(p-side2)*(p-side3);
//        Math.pow(s, 1.0/2);
        System.out.println("三角形的面积是："+Math.pow(s, 1.0/2));
    }





    public double getSide1() {
        return side1;
    }

    public double getSide2() {
        return side2;
    }

    public double getSide3() {
        return side3;
    }

    public void setSide1(double side1) {
        this.side1 = side1;
    }

    public void setSide2(double side2) {
        this.side2 = side2;
    }

    public void setSide3(double side3) {
        this.side3 = side3;
    }
}
